$(function () {
    var paymentHandle_datagrid;
    paymentHandle_datagrid = $("#paymentHandle_datagrid");
    //页面的展示
    paymentHandle_datagrid.datagrid({
        // fit:true,
        fitColumns:true,
        url:"/paymentHandle/list",
        singleSelect:true,
        rownumbers:true,
        pagination:true,
        columns:[[
            {field:'orderBill',title:'投保单号',width:10,align:'center',formatter:orderBillNumberFormatter},
            {field:'paymentType',title:'缴费类型',width:10,align:'center',formatter:paymentTypeFormatter},
            {field:'product',title:'产品',width:10,align:'center',formatter:productNameFormatter},
            {field:'organization',title:'承保机构',width:10,align:'center',formatter:organizationFormatter},
            {field:'beginTime',title:'起保日期',width:10,align:'center',formatter:beginTimeFormatter},
            {field:'endTime',title:'停保日期',width:10,align:'center',formatter:endTimeFormatter},
            {field:'issue',title:'期次',width:10,align:'center',formatter:issuetFormatter},
            {field:'amount',title:'保费金额',width:10,align:'center',formatter:amountFormatter},
            {field:'coverage',title:'应缴金额',width:10,align:'center',formatter:coverageFormatter},
            {field:'client',title:'投保人',width:10,align:'center',formatter:clientFormatter},
            {field:'state',title:'处理状态',width:10,align:'center'},
            {field:'serialNumber',title:'收据流水号',width:10,align:'center'}
        ]]
    })
    //
});
function orderBillNumberFormatter(value,row,index) {
    return row.orderBill.orderBillNumber;
}

function issuetFormatter(value,row,index) {
    return row.orderBill.issue;
}

function productNameFormatter(value,row,index) {
    return row.product.name;
}

function paymentTypeFormatter(value,row,index) {
    return row.orderBill.paymentType;
}

function beginTimeFormatter(value,row,index) {
    return row.orderBill.beginTime;
}

function endTimeFormatter(value,row,index) {
    return row.orderBill.endTime;
}

function amountFormatter(value,row,index) {
    return row.premium.amount;
}

function coverageFormatter(value,row,index) {
    return row.premium.coverage;
}

function clientFormatter(value,row,index) {
    return row.client.realName;
}

function organizationFormatter(value,row,index) {
    return row.organization.organizationName;
}

